package net.sunzc.takephoto.utils;

import android.app.AlertDialog;
import android.content.Context;
import android.graphics.Bitmap;
import android.widget.ImageView;

/**
 * Created by sunzc on 2017/2/13.
 */
public class Test {
    private static final String TAG = "test";
    public static boolean OLD = false;//适用于旧设备上测试用
    public static boolean DEBUG = true;// 正式发布请确定清单文件中的version_code
    static boolean LOG = true;

    public static String getIcValue(String coachId) {
        return OLD ? "150104197306041514" : coachId;
    }

    public static double getLatitude(double latitude) {
//        return Constants.DEBUG ? 32.653417 : latitude;
        return latitude;
    }

    public static int getCaptureTime(int time) {
        return DEBUG ? 60 : time;
    }

    public static double getLongitude(double longitude) {
//        return Constants.DEBUG ? 112.082381 : longitude;
        return longitude;
    }

    public static void showPhoto(Context context, Bitmap photo) {
        if (photo == null) MyLog.e(TAG, "显示的图片为空");
        if (DEBUG) {
            AlertDialog.Builder builder = new AlertDialog.Builder(context);
            ImageView view = new ImageView(context);
            view.setImageBitmap(photo);
            final AlertDialog dialog = builder.setView(view).show();
            view.postDelayed(new Runnable() {
                @Override
                public void run() {
                    if (dialog.isShowing())
                        dialog.dismiss();
                }
            }, 10000);
        }
    }

    public static long getOrderTimeC(long mOrderTimeC) {
        return DEBUG ? 600000 : mOrderTimeC;
    }

    public static String getVehicleCheckMode(String vehiclCheckMode) {
        return vehiclCheckMode;
    }
}
